Type Inference for Bimorphic Recursion

نویسندگان

  • Makoto Tatsuta
  • Ferruccio Damiani
چکیده

This paper proposes bimorphic recursion, which is restricted polymorphic recursion such that every recursive call in the body of a function definition has the same type. Bimorphic recursion allows us to assign two different types to a recursively defined function: one is for its recursive calls and the other is for its calls outside its definition. Bimorphic recursion in this paper can be nested. This paper shows bimorphic recursion has principal types and decidable type inference. Hence bimorphic recursion gives us flexible typing for recursion with decidable type inference. This paper also shows that its typability becomes undecidable because of nesting of recursions when one removes the instantiation property from the bimorphic recursion.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Practical Type Inference for Polymorphic Recursion: an Implementation in Haskell

This paper describes a practical type inference algorithm for typing polymorphic and possibly mutually recursive definitions, using Haskell to provide a highlevel implementation of the algorithm.

متن کامل

What Are Principal Typings and What Are They Good For? Technical Memorandum Mittlcsstmm532

We demonstrate the pragmatic value of the principal typing property, a property more general than ML's principal type property, by studying a type system with principal typings. The type system is based on rank 2 intersection types and is closely related to ML. Its principal typing property provides elegant support for separate compilation, including \smartest recompilation" and incremental typ...

متن کامل

Récursion généralisée et inférence de types avec intersection. (Generalised recursion and type inference for intersection types)

In the first part, we define a new programming language with a functional core and generalised recursion, by using Boudol’s type system with degrees to rule out unsafe recursions. The language is extended first with recursive records, then with mixins, allowing the programmer to fully mix functional and object-oriented paradigms. We also present an implementation, MlObj, and an abstract machine...

متن کامل

Towards Constraint-based Type Inference with Polymorphic Recursion for Functional and Logic Programs

Type inference in the context of polymorphic recursion is notoriously difficult. The extensions to the traditional λ-calculus type inference algorithm by both Hindley-Milner and Mycroft are not capable of deriving the most general, i.e. principal types for programs with polymorphic recursion. Henglein has proposed a different algorithm, based on arrow graph reweriting, with an extended occurs c...

متن کامل

A Certified Interpreter for ML with Structural Polymorphism

The type system of Objective Caml has many unique features, which make ensuring the correctness of its implementation difficult. One of these features is structurally polymorphic types, such as polymorphic object and variant types, which have the extra specificity of allowing recursion. I implemented in Coq a certified interpreter for Core ML extended with structural polymorphism and recursion....

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2011